
import { IsString, IsNumber, IsBoolean, IsDate, IsOptional, IsEnum } from 'class-validator';
import { ApiProperty, OmitType, IntersectionType } from '@nestjs/swagger';
import { PagingDto } from 'src/common/dto/index';
import { CharEnum } from 'src/common/enum/index';


export class BaseCampusDto{
	@ApiProperty({required: false , description: '校区ID'})
	@IsOptional()
	@IsNumber()
	campusId?: number;

	@ApiProperty({enum: CharEnum, required: false , description: '删除标志'})
	@IsOptional()
	@IsString()
	delFlag?: string;

	@ApiProperty({enum: CharEnum, required: false , description: '校区名称'})
	@IsOptional()
	@IsString()
	campusName?: string;

	@ApiProperty({enum: CharEnum, required: false , description: '状态'})
	@IsOptional()
	@IsString()
	status?: string;

	@ApiProperty({required: false , description: '创建者'})
	@IsOptional()
	@IsString()
	createBy?: string;

	@ApiProperty({required: false , description: '创建时间'})
	@IsOptional()
	@IsString()
	createTime?: string;

	@ApiProperty({required: false , description: '更新者'})
	@IsOptional()
	@IsString()
	updateBy?: string;

	@ApiProperty({required: false , description: '更新时间'})
	@IsOptional()
	@IsString()
	updateTime?: string;

	@ApiProperty({required: false , description: '备注'})
	@IsOptional()
	@IsString()
	remark?: string;

	@ApiProperty({required: false , description: '校区编码'})
	@IsOptional()
	@IsString()
	campusCode?: string;

	@ApiProperty({required: false , description: '归属学校'})
	@IsOptional()
	schoolId?: number;

	@ApiProperty({required: false , description: '行政区域'})
	@IsOptional()
	@IsString()
	origin?: string;

	@ApiProperty({required: false , description: '经纬度'})
	@IsOptional()
	@IsString()
	position?: string;

	@ApiProperty({required: false , description: '地址信息'})
	@IsOptional()
	@IsString()
	address?: string;

	@ApiProperty({required: false , description: '联系人'})
	@IsOptional()
	@IsString()
	contactName?: string;

	@ApiProperty({required: false , description: '联系电话'})
	@IsOptional()
	@IsString()
	contactPhone?: string;

}

export class CreateCampusDto extends OmitType(BaseCampusDto, [ 'campusId', 'delFlag']){}

export class UpdateCampusDto extends OmitType(BaseCampusDto, [ 'delFlag', 'createBy', 'createTime']){}

export class QueryCampusDto extends IntersectionType( BaseCampusDto, PagingDto){}

export class ListCampusDto  extends OmitType(BaseCampusDto, [ 'delFlag', 'createBy', 'createTime', 'updateBy', 'updateTime']) {}
